program f;

{$APPTYPE CONSOLE}

var
  n, m, a, b: Integer;
  a: array[1..100000] of Integer;
begin
  readln(n, m);
  for i := 1 to m do
    readln(a, b);
  readln(sc);
  for i := 1 to n do
    if '[ ] ' + sc = sa[i] then
      writeln('[/] ' + sc)
    else
      writeln(sa[i]);
end.
